package com.feng.d16openclosedprinciple.goodsmell;

import com.feng.d16openclosedprinciple.badsmell.AlertRule;
import com.feng.d16openclosedprinciple.badsmell.Notification;

/**
 * 处理各种报警逻辑,由其子类处理不同的报警逻辑,这样就消灭了很多的if语句
 *
 * @author LiYilin on 2020/4/11
 */
public abstract class AbstractAlertHandler {

    protected AlertRule rule;
    protected Notification notification;

    public AbstractAlertHandler(AlertRule rule, Notification notification) {
        this.rule = rule;
        this.notification = notification;
    }

    /**
     * 处理报警的逻辑,由子类具体实现
     * @param apiStatInfo /
     */
    public abstract void check(ApiStatInfo apiStatInfo);
}
